#include <iostream>

using namespace std;

class Rational
{
	int numerator;
	int denominator; 

	void setNumerator(int a){numerator = a;}
	void setDenominator(int b){denominator = b;}

	int binEuclidean(int m, int n) const;
	Rational reduce(const Rational &r) const;
	
public:
	Rational(int, int);
	Rational(int);

	double getDouble(const Rational &r);
	
	int getNumerator() const {return numerator;}
	int getDenominator() const {return denominator;}

	Rational operator+(const Rational &r) const;
	Rational operator-(const Rational &r) const;
	Rational operator*(const Rational &r) const;
	Rational operator/(const Rational &r) const;


	Rational operator++();
	Rational operator++(int i);
	Rational operator--();
	Rational operator--(int i);
	


    bool operator==(const Rational &r2);
	bool operator!=(const Rational &r2);
	bool operator<(const Rational &r2);
	bool operator>(const Rational &r2);
	bool operator<=(const Rational &r2);
	bool operator>=(const Rational &r2);



	void print() const
	{
		cout << getNumerator() << " " << getDenominator() << endl;
	}
	

};
